package com.hdx.server.mapper;


import com.github.pagehelper.Page;
import com.hdx.model.dto.GoodsSalesDTO;
import com.hdx.model.dto.OrdersPageQueryDTO;
import com.hdx.model.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
    //xml(pageQuery)
    Page<Orders> pageQuery(OrdersPageQueryDTO ordersPageQueryDTO);

    @Select("select count(id) from orders where status=#{status}")
    Integer countStatus(Integer toBeConfirmed);

    void update(Orders orders);
    @Select("select * from orders where id=#{id}")
    Orders getById(Long orderId);

    Double sumByMap(Map map);

    Integer countByMap(Map map);


    List<GoodsSalesDTO> getSalesTop10(LocalDateTime begin, LocalDateTime end);

    void insert(Orders orders);
}
